\documentclass[a4paper]{article}

\usepackage{pgfplots}

\usepgfplotslibrary{statistics}

\begin{document}
\begin{tikzpicture}
%\tracingmacros=2 \tracingcommands=2
	\begin{axis}[
		legend entries={smallest,mid,max},
		legend pos=outer north east,
		boxplot/variable width,
	]

	\addplot+[
		boxplot prepared={
			lower whisker=3,
			lower quartile=6,
			median=7,
			upper quartile=8.5,
			upper whisker=11,
			sample size=400,
		},
	]
	table[row sep=\\,y=v] {
	v\\
	1\\	2.5\\	12\\
	};

	\addplot+[
		boxplot prepared={
			lower whisker=3,
			lower quartile=6,
			median=7,
			upper quartile=8.5,
			upper whisker=11,
			sample size=20000,
		},
	]
	table[row sep=\\,y=v] {
	v\\
	1\\	2.5\\	12\\
	};

	\addplot+[
		boxplot prepared={
			lower whisker=3,
			lower quartile=6,
			median=7,
			upper quartile=8.5,
			upper whisker=11,
			sample size=40000,
		},
	]
	table[row sep=\\,y=v] {
	v\\
	1\\	2.5\\	12\\
	};
	\end{axis}

\end{tikzpicture}

\end{document}

